package com.jsrj.service.impl;

import com.jsrj.domain.Advertorial;
import com.jsrj.mapper.AdvertorialMapper;
import com.jsrj.service.IAdvertorialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-03
 */
@Service
public class AdvertorialServiceImpl implements IAdvertorialService
{
    @Autowired
    private AdvertorialMapper advertorialMapper;

    /**
     * 查询【请填写功能名称】
     * 
     * @param title 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public Advertorial selectAdvertorialByTitle(String title)
    {
        return advertorialMapper.selectAdvertorialByTitle(title);
    }

    /**
     * 查询【请填写功能名称】列表
     * 
     * @param advertorial 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<Advertorial> selectAdvertorialList(Advertorial advertorial)
    {
        return advertorialMapper.selectAdvertorialList(advertorial);
    }

    /**
     * 新增【请填写功能名称】
     * 
     * @param advertorial 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertAdvertorial(Advertorial advertorial)
    {
        return advertorialMapper.insertAdvertorial(advertorial);
    }

    /**
     * 修改【请填写功能名称】
     * 
     * @param advertorial 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateAdvertorial(Advertorial advertorial)
    {
        return advertorialMapper.updateAdvertorial(advertorial);
    }

    /**
     * 批量删除【请填写功能名称】
     * 
     * @param titles 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteAdvertorialByTitles(String[] titles)
    {
        return advertorialMapper.deleteAdvertorialByTitles(titles);
    }

    /**
     * 删除【请填写功能名称】信息
     * 
     * @param title 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteAdvertorialByTitle(String title)
    {
        return advertorialMapper.deleteAdvertorialByTitle(title);
    }

    @Override
    public Integer insertAdver(Advertorial advertorial) {
        return advertorialMapper.insertAdver(advertorial);
    }

    @Override
    public Integer updateAdver(Advertorial advertorial) {
        return advertorialMapper.updateAdvertorial(advertorial);
    }

    @Override
    public Integer deleteAdver(Long id) {
        return advertorialMapper.deleteAdver(id);
    }


    /**
     * 根据标题，内容，关键字模糊查询
     * vague:模糊
     */
    @Override
    public List<Advertorial> queryVague(String vague) {
        return advertorialMapper.queryVague(vague);
    }

    @Override
    public Advertorial queryAdvByImageId(Long id) {
        return advertorialMapper.queryAdvByImageId(id);
    }

    /**
     * 查询全部
     * @return
     */
    @Override
    public List<Advertorial> queryAllAdvertorials() {
        return advertorialMapper.selectAll();
    }

    @Override
    public List<Advertorial> queryAdvByShopId(Long id) {
        return advertorialMapper.queryAdvByShopId(id);
    }

    @Override
    public Advertorial queryAdvById(Long id) {
        return advertorialMapper.queryAdvById(id);
    }


}
